package net.xuele.learn.mytomcat;

/**
 * Created by GaoQingming on 2019/4/13 0013.
 */
public abstract class MyServlet {

    public abstract void doGet(MyRequest myRequest,MyResponse myResponse);

    public abstract void doPost(MyRequest myRequest,MyResponse myResponse);


    public void service(MyRequest myRequest,MyResponse myResponse) {
        if ("POST".equalsIgnoreCase(myRequest.getMethod())) {
            doPost(myRequest,myResponse);
        } else if ("GET".equalsIgnoreCase(myRequest.getMethod())) {
            doGet(myRequest,myResponse);
        }
    }
}
